package com.rk.cust.Dao;

import com.rk.cust.entity.po.CustPo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.annotation.Resource;

@Resource
public interface JpaCustRepository extends JpaRepository<CustPo, Long> {

    @Modifying
    @Query(value = "update cust c set " +
            "c.corporation=:#{#custPo.corporation}, " +
            "c.certType=:#{#custPo.certType}, " +
            "c.certNo=:#{#custPo.certNo}, " +
            "c.status=:#{#custPo.status}, " +
            "c.lastUpdateTime=:#{#custPo.lastUpdateTime} " +
            "where c.id=:#{#custPo.id}")
    int updateCust(CustPo custPo);

}
